#ifndef UMAINWINDOW_H
#define UMAINWINDOW_H

#include "utkwidget_export.h"

#include <QMainWindow>

class UTitleBar;
class QMenu;
class UMainWindowPrivate;

class UTKWIDGET_EXPORT UMainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit UMainWindow(QWidget* parent = nullptr);
    ~UMainWindow();

    void setMargins(int nMargins);
    
    UTitleBar* titleBar() const;

    void moveToCenter();

    void moveToCenter(const QPoint &point);

    void addMenu(QMenu* menu);

    void addDropShadowEffect(bool isOpen);

    void setRadius(int radius);

    void setBackground(int role);

    QMenuBar *menuBar() const = delete;
    void setMenuBar(QMenuBar *menubar) = delete;

    QWidget *menuWidget() const = delete;
    void setMenuWidget(QWidget *menubar) = delete;

    QRect screenRect();

private:
    void initConnections();
    void initWindowLong();

protected:
    void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE;
#ifdef Q_OS_WIN
    bool nativeEvent(const QByteArray &eventType, void* message, long* result) Q_DECL_OVERRIDE;
#endif

public slots:
    void onWindowStateChange();
    void onMinimizeButtonClicked();
    void onMaximizeButtonClicked();
    void onCloseButtonClicked();
    void setTitleBarMoveable(bool bMoveable);

private:
    QScopedPointer<UMainWindowPrivate> d_ptr;
    Q_DISABLE_COPY(UMainWindow)
    Q_DECLARE_PRIVATE_D(d_ptr, UMainWindow)
};

#endif // UMAINWINDOW_H
